﻿using AmiDraw.Editor.Component;
using AmiDraw.Lib;
using AmiDraw.Lib.Models;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace AmiDraw.Editor.View.Dialog
{
    /// <summary>
    /// MultiplotImageEditView.xaml 的交互逻辑
    /// </summary>
    public partial class MultiplotImageEditView : Window
    {
        public MultiplotImageEditView()
        {
            InitializeComponent();
        }

    }

    public class Selecter : DataTemplateSelector
    {
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {

            if(item is null)
            {
                return null;
            }
            var el = container as FrameworkElement;


            var _item = item as MultiplotElemtentBase;
            return _item?.Name switch
            {
                "Rectangle" => el.FindResource("rect") as DataTemplate,
                "Image" => el.FindResource("image") as DataTemplate,
                "Text" => el.FindResource("text") as DataTemplate,
                _ => throw new NotImplementedException()
            };



        }
    }
}
